<?php get_instance()->view('common/header');?>
<style type="text/css">
    .portrait{max-width: 100%}
</style>
<div class="page-container home">
    <?php get_instance()->view('common/sidebar');?>
    <div class="page-content-wrapper">
        <div class="page-content">
            <div class="row">
                <div class="col-md-12">
                    <!-- BEGIN PAGE TITLE & BREADCRUMB-->
                    <h3 class="page-title"> <?php echo $title.' - 【 '.$time.' 】'?></h3>
                    <ul class="page-breadcrumb breadcrumb">
                        <li><i class="fa fa-home"></i> <a href="<?php echo getUrl('statistics/merchant');?>">商家销量统计 </a><i class="fa fa-angle-right"></i></li>
                        <li><a href="<?php echo getUrl('statistics/merchant/product?id='.get('merchant').'&stime='.get('stime').'&etime='.get('etime'));?>">商品销量 </a><i class="fa fa-angle-right"></i></li>
                        <li> <a href="javascript:;"><?php echo $title?> </a></li>
                    </ul>
                    <!-- END PAGE TITLE & BREADCRUMB-->
                </div>
            </div>
            <div class="row">
                <div class="col-md-12">
                    <div class="portlet">
                        <div class="portlet-body">
                            <div class="table-container">
                                <div class="table-actions-wrapper"> <span> </span>
                                    <?php if(adminAuthority('merchant-detailExport', 'statistics')):?>
                                        <a class="btn btn-sm blue add export" href="javascript:;"><i class="fa fa-download"></i> 导出</a>
                                    <?php endif;?>
                                </div>
                                <table class="table table-bordered table-hover" id="datatable">
                                    <thead>
                                    <tr role="row" class="heading">
                                        <th sort="false">产品名称</th>
                                        <th sort="false">所属分类</th>
                                        <th sort="false">订单号</th>
                                        <th sort="false">下单时间</th>
                                        <th sort="false">接单时间</th>
                                        <th sort="false">销售数量</th>
                                        <th sort="false">销售单价</th>
                                        <th sort="false">销售总额</th>
                                        <th sort="false">操作</th>
                                    </tr>
                                    </thead>
                                    <tbody></tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(function(){
        datatable_init({
            src: $("#datatable"),
            sAjaxSource: "<?php echo getUrl('statistics/merchant/detailsGetList'.$url);?>",
            aoColumnDefs : [
                {
                    'bSortable' : false,
                    'aTargets' : [0,1,2,3,4,5,6,7,8]
                }
            ]
        });

        $(".export").on('click',function () {
            window.location.href="<?php echo getUrl('statistics/merchant/detailExport'.$url)?>";
        })
    });
</script>
</body>
</html>
